;(function ($,window,document,undefined){
	MYLIB.LOADING = function (msg){
		if(!MYLIB.$loading){
			MYLIB.$loading = $('<div class="overlay-loading"></div>');
		}
		$('#'+MYLIB.constant.app_id).append(MYLIB.$loading);
		
	}
	MYLIB.REMOVE_LOADING = function (callbacksuccess){
		setTimeout(function () {
			if(MYLIB.$loading !== 'undefined'){
				MYLIB.$loading.detach();
				if(callbacksuccess && typeof(callbacksuccess) === 'function')
					callbacksuccess();
			}
				
		}, 1000);
	}

	MYLIB.LOADING_LITTLE = function ($el,msg){
		if(!MYLIB.$loading_little){
			MYLIB.$loading_little = $('<div class="loading_little"><img src="imgs/theme/spin.svg"/>'+msg+'<div>');
		}
		$el.append(MYLIB.$loading_little);

	}

	MYLIB.REMOVE_LOADING_LITTLE = function ($el){

		setTimeout(function () {

			$el.find(MYLIB.$loading_little).detach();
			// MYLIB.$loading_little.delay();
						
		}, 1000);

	}

})(jQuery,window,document)